package com.quanquan.store.entity;


import lombok.Data;
import org.hibernate.annotations.Type;

import javax.persistence.*;

/**
 * 团购实体
 */
@Data
@Entity
@Table(name = "oo_group_buying")
public class GroupBuying{



    @Id
    @Column(name = "id", unique = true, length = 64)
    private String id;


    /**
     * 团购活动名称
     */
    @Column(name = "group_buying_name", length = 32)
    private String groupBuyingName;

    /**
     * 团购开始时间
     **/
    @Column(name = "start_time", nullable = false, length = 32)
    private String startTime;


    /**
     * 团购结束时间
     **/
    @Column(name = "end_time", nullable = false, length = 32)
    private String endTime;


    /**
     * 商品库存
     */
    @Column(name = "inventory", columnDefinition = "INT")
    private Integer inventory;

    /**
     * 团购价格
     */
    @Column(name = "price", columnDefinition = "DOUBLE")
    private Double price;

    /**
     * 原价
     */
    @Column(name = "original_price", length = 32)
    private String originalPrice;


    /**
     * 秒杀价格(积分)
     */
    @Column(name = "integral", columnDefinition = "INT")
    private Integer integral;

    /**
     * 原价(积分)
     */
    @Column(name = "original_integral", length = 32)
    private String originalIntegral;


    /**
     * 秒杀商品分面
     */
    @Column(name = "cover_url", length = 255)
    private String coverUrl;

    /**
     * 团购商品(保存对应商品的id)
     */
    @Column(name = "goods_id", length = 64)
    private String goodsId;

    /**
     * 是否显示 0是显示 1是不显示
     */
    @Column(name = "status_show", columnDefinition = "INT default 0", nullable = false)
    private Integer show;


    /**
     * 是否删除 0 不删除 1 删除
     */
    @Column(name = "remove", columnDefinition = "INT default 0", nullable = false)
    private Integer remove;


    @Column(name = "share_url", length = 255)
    private String shareUrl;

    /**
     * 创建时间
     */
    @Column(name = "create_time", nullable = false, length = 32)
    private String createTime;

    /**
     * 秒杀商品的类型 (goods,coupon  商品，优惠券)
     */
    @Column(name = "goods_type",length = 32)
    private String goodsType;

    /**
     * 秒杀商品状态 preparing：准备中  processing ：进行中  over：已经结束 sellOut 售罄 failure 未成团
     */
    @Column(name = "kill_status",length = 32)
    private String killStatus;


    /**
     * 秒杀商品介绍
     **/
    @Column(name = "content", columnDefinition = "TEXT")
    private String content;

    /**
     * 使用规则
     **/
    @Column(name = "use_rule",length = 256)
    private String useRule;


    /**
     *支付类型  integral 积分  money 现金
     **/
    @Column(name = "pay_type",length = 64)
    private String payType;

    /**
     * 组团人数
     */
    @Column(name = "group_num",length = 64)
    private Integer groupNum;


    /**
     * 最少拼团人数
     */
    @Column(name = "threshold",length = 64)
    private Integer threshold;
    /**
     * 倒计时
     */
    @Transient
    private Long countdown;

    /**
     * 剩余库存
     */
    @Transient
    private Integer remainingInventory;


    /**
     * 已支付完成的订单数
     */
    @Transient
    private Integer completePayment;

}
